package xyz.scootaloo.draft.demo;

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

/**
 * @author flutterdash@qq.com
 * @since 2021/5/15 16:21
 */
public class Case5 {

    public static void main(String[] args) throws ExecutionException, InterruptedException {
        Callable<Integer> callable = new FeatureInteger();
        FutureTask<Integer> ft = new FutureTask<>(callable);
        new Thread(ft).start();
        System.out.println(ft.get());
    }

    private static class FeatureInteger implements Callable<Integer> {

        @Override
        public Integer call() {
            return 1;
        }

    }

}
